<template>
    <div>
        <nav class="navbar navbar-expand-lg navbar-dark bg-dark">
            <div class="container">
                <router-link class="navbar-brand" :to="{name: 'home'}">yc的博客</router-link>
                <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
                <span class="navbar-toggler-icon"></span>
                </button>
                <div class="collapse navbar-collapse" id="navbarSupportedContent">
                <ul class="navbar-nav me-auto mb-2 mb-lg-0" style="margin-left: 20vh">
                    <li class="nav-item">
                        <router-link class="nav-link" :class="route_name == 'index' ? 'nav-link active' : 'nav-link'" aria-current="page" :to="{name: 'index'}">我的文章</router-link>
                    </li>
                    <li class="nav-item" style="margin-left: 5vh">
                        <router-link class="nav-link" :class="route_name == 'online' ? 'nav-link active' : 'nav-link'" :to="{name: 'online'}">学累了写会题</router-link>
                    </li>
                    <li class="nav-item" style="margin-left: 5vh">
                        <router-link class="nav-link" :class="route_name == 'game' ? 'nav-link active' : 'nav-link'" :to="{name: 'game'}">学累了摸会🐟</router-link>
                    </li>
                </ul>
                <!-- <ul class="navbar-nav" style="margin-right: 20vh">
                    <li class="nav-item">
                        <span class="d-inline-block" tabindex="0" data-bs-toggle="popover" data-bs-trigger="hover focus" data-bs-content="Disabled popover">
                            <router-link class="nav-link" @mouseenter="showAboutMe" aria-current="page" :to="{name: 'about'}">YC</router-link>
                        </span>
                    </li>
                </ul> -->
                <!-- 下拉框 -->
                <ul class="navbar-nav" style="margin-right: 20vh">
                    <li class="nav-item dropdown">
                    <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
                        YC
                    </a>
                    <ul class="dropdown-menu" style="width: 20vh" aria-labelledby="navbarDropdown">
                        <li><router-link class="dropdown-item" :to="{name: 'write'}" >去写文章</router-link></li>
                        <li><hr class="dropdown-divider"></li>
                        <li><a class="dropdown-item" href="#">退出</a></li>
                    </ul>
                    </li>
                </ul>
                <!-- 搜索框 -->
                <!-- <form class="d-flex" role="search">
                    <input class="form-control me-2" type="search" placeholder="Search" aria-label="Search">
                    <button class="btn btn-outline-success" type="submit">Search</button>
                </form> -->
                </div>
            </div>
          </nav>
    </div>
</template>

<script>
import { useRoute } from 'vue-router';
import { computed } from 'vue'

export default {
    setup() {
        const route = useRoute();
        let route_name = computed(() => route.name);

        const showAboutMe = () => {
            
        }


        return {
            route_name,
            showAboutMe
        }
    }
}
</script>

<style scoped>
</style>